home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / PIL / TarIO.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  979b  |  33 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import ContainerIO
  5. import string
  6.  
  7. class TarIO(ContainerIO.ContainerIO):
  8.     
  9.     def __init__(self, tarfile, file):
  10.         fh = open(tarfile, 'rb')
  11.         while None:
  12.             s = fh.read(512)
  13.             if len(s) != 512:
  14.                 raise IOError, 'unexpected end of tar file'
  15.             
  16.             name = s[:100]
  17.             i = string.find(name, chr(0))
  18.             if i == 0:
  19.                 raise IOError, 'cannot find subfile'
  20.             
  21.             if i > 0:
  22.                 name = name[:i]
  23.             
  24.             size = string.atoi(s[124:136], 8)
  25.             if file == name:
  26.                 break
  27.             
  28.             continue
  29.             ContainerIO.ContainerIO.__init__(self, fh, fh.tell(), size)
  30.             return None
  31.  
  32.  
  33.